#include "settingsextension.h"
#include "ui_settingsextension.h"

#include <QDesktopServices>
#include <QFileDialog>
#include <QStandardPaths>

SettingsExtension::SettingsExtension(QWidget *parent) : ZTBoxInterface(),
    ui(new Ui::SettingsExtension)
{
    ui->setupUi(this);

    ui->lineEdit->setText(userConfigDir().append("zToolsBox/plugins"));
}

SettingsExtension::~SettingsExtension()
{
    delete ui;
}

QString SettingsExtension::userConfigDir() {
    return QStandardPaths::locate(QStandardPaths::ConfigLocation, "", QStandardPaths::LocateDirectory);
}

void SettingsExtension::on_openDir_clicked()
{
    QDesktopServices::openUrl(QUrl(ui->lineEdit->text()));
}

QString SettingsExtension::PluginName() {
    return ">Settings";
}

bool SettingsExtension::PluginxAlwaysDisplay()
{
    return true;
}

